package cn.iocoder.yudao.module.member.job;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 会员时间 Job
 *
 */
@Component
@Slf4j
public class MemberJob{

    @Resource
    private MemberUserService memberUserService;
    @TenantJob
    @Scheduled(cron = "0 */1 * * * ?")  // 每分钟执行一次
    public String execute() throws Exception {
        int notifyCount = memberUserService.executeMemberUser();
        return String.format("执行支付通知 %s 个", notifyCount);
    }

}
